<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:choose>
<c:when test="${empty sachantSession && empty apprenantSession }">
	<!-- Si aucun utilisateur n'est connecté -->
	<jsp:include page="login.jsp" />
</c:when>
<c:otherwise>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
	<script type="text/javascript" src="javascript/jquery.js"></script>
	<script type="text/javascript" src="javascript/tinymce/tinymce.js"></script>
	<script type="text/javascript" src="javascript/highlight/highlight.pack.js"></script>
	
	
	<script type="text/javascript">
	tinymce.init({
		language : 'fr_FR',
	    selector: "textarea",
	    	 plugins: "image",
	    	    image_advtab: true,
	    	        element_format : "html"
	 });
	 
	$(document).ready(function() {
	
		//on entoure de balise pre le code rajouté par tinymce afin de garder la mise en page du code
		$("code[class='php']").wrap("<pre></pre>");
		$("code[class='sql']").wrap("<pre></pre>");
		$("code[class='java']").wrap("<pre></pre>");
		$('pre code').each(function(i, e) {hljs.highlightBlock(e)});
		
		//on retire les caractères rajouté dyanimiquement par Tinymce 
		$('.affichageQuestionOuProposition').each(function(){
			$(this).html($(this).html().replace(/<\/pre><br><br><pre>/g, "</pre><pre>"));
			$(this).html($(this).html().replace(/<\/pre><br><pre>/g, "</pre><pre>"));
		});
		
	
		
	});
	 
	</script>
	
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<link rel="stylesheet" href="css/screen.css" type="text/css" media="screen" title="css" charset="utf-8" />
	<link rel="stylesheet" href="css/highlight/default.css" type="text/css" media="screen" title="css" charset="utf-8" />
	<title>Projet QCM</title>
	</head>
	<body>
		<div id="content">
			<jsp:include page="template/header.jsp" />
	
			<div id="body">
				<jsp:include page="template/menu_left.jsp" />
	
				<div id="contenu">
					<p class="error">${erreurPage}</p>
					<c:if test="${not empty page}">
						<jsp:include page="${page}" />
					</c:if>
				</div>
			</div>
			<jsp:include page="template/footer.jsp" />
		</div>
	</body>
	</html>
</c:otherwise>
</c:choose>